<?php
	include('functions.php');
	date_default_timezone_set('Europe/Copenhagen');	
	$runs = 10;

	l('RegEx - Full Text Search on post with case-insensitivity - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.1','0', $i); 
	}

	l('RegEx - Full Text Search on both post with case-sensitive - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.1.1','0', $i); 
	}
	
	l('RegEx - Full Text Search on both post without case-insensitivity - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.1.2','0', $i); 
	}

	l('RegEx - Full Text Search on both post with case-insensitivity, sorted by date descending - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.2','0', $i); 
	}

	index('posts', array('post' => 1));

	l('RegEx - Full Text Search on both post and post title - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.1','1', $i); 
	}

	l('RegEx - Full Text Search on both post without case-insensitivity - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.1.1','0', $i); 
	}

	l('RegEx - Full Text Search on both post and post title, sorted by date descending - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.2','1', $i); 
	}

	// INDEX
	index('posts', array('date' => 1));

	l('RegEx - Full Text Search on both post and post title - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.1','1', $i); 
	}

	l('RegEx - Full Text Search on both post without case-insensitivity - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.1.1','0', $i); 
	}

	l('RegEx - Full Text Search on both post and post title, sorted by date descending - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.2','1', $i); 
	}

	// INDEX
	index('posts', array('tags' => 1));

	l('RegEx - Full Text Search on both post and post title - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.1','1', $i); 
	}

	l('RegEx - Full Text Search on both post without case-insensitivity - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.1.1','0', $i); 
	}

	l('RegEx - Full Text Search on both post and post title, sorted by date descending - Time: '	. date("d / m - Y H:i:s", time()));
	for($i=0; $i<$runs; $i++) {
		set_time_limit(0);
		query('q1.2','1', $i); 
	}
	echo "DONE!";
?>